package com.tjw.ec.upms.api.feign;

import com.tjw.ec.common.core.constant.ServiceNameConstants;
import com.tjw.ec.common.core.util.Response;
import com.tjw.ec.common.web.config.FeignOauth2RequestInterceptor;
import com.tjw.ec.upms.api.dto.PermitVO;
import com.tjw.ec.upms.api.feign.factory.RemotePermitServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 远程调用接口 : 由tb_Module与tb_Action两表结合产生的系统基本权限表;
 *
 * @author T-junwen
 * @email t-junwen@foxmail.com
 * @date 2019-08-02 11:58:44
 */
@FeignClient(contextId = "remotePermitService", value = ServiceNameConstants.UMPS_SERVICE,configuration = FeignOauth2RequestInterceptor.class, fallbackFactory = RemotePermitServiceFallbackFactory.class)
public interface RemotePermitService {

    /**
     * @Title: 根据用户编号获取用户权限
     * @Param: [userId]
     * @return: com.tjw.ec.common.core.util.Response<java.util.List<com.tjw.ec.upms.api.dto.PermitVO>>
     * @Author: 田俊文
     * @Date: 2019/8/2 15:00
     * @Throws:
     */
    @GetMapping("permit/getPermitByUserId/{userId}")
    Response<List<PermitVO>> getPermitByUserId(@PathVariable("userId")String userId);
}

